s = input("Введите скобочную последовательность")
while "()" in s or "{}" in s or "[]" in s or "<>" in s:
    if "()" in s:
        s = s.replace("()","")
    if "{}" in s:
        s = s.replace("{}","")
    if "[]" in s:
        s = s.replace("[]","")
    if "<>" in s:
        s = s.replace("<>","")
if s == "":
    print("True")
if s != "":
    print("False")
    

